Firestore Set Document function

Hello, I need to create a Set Document function to update data in Firestore. I’ve tried several things unsuccessfully with the code. Any help or tips would greatly be appreciated! Thanks!

Welcome @keith7 ! Did you happen to see the Update Document action under the Firebase Admin SDK app?

2022-05-01 21.47.17

Thanks for your reply! Yes, I did test that but I need the Update or Create functionality that Set Document has. I also need to be able to set the Document name which the Create action does not have that option. I copied the Update Document code from git and I’ve attempted unsuccessfully to modify it.

Also, I think I will need custom code for this action because the payload coming from my API call has an array with multiple objects. I need to be able to add a For loop to Set each object individually in Firestore.

1 Like

Hi @keith7 ,

Sorry to hear you’re having trouble modifying the underlying action to fit your needs.

You can either hire an expert to help you with this task, or you can request to have it enhanced on our public issue tracker.

You’re correct on the looping question, you can make a code step using Node.js, Python, Go or Bash to loop over those records and perform the action, or alternatively call another workflow via an HTTP request so you can reuse the built in Firestore Admin Update Record action.

Hope this helps!