Assuming you are using the Call REST Activity. You can set up how to handle the response
You could store it as a string variable and filter out the id, but it would be better to use an import mapping.
Take a look at this section of the Import/Export Learning path to find out more about working with a (JSON) response. I would recommend you to walk through the entire path to get a good overview of the integration structure. And it will explain how to interpret the things you see below in detail.
If you paste your response into a JSON structure, you will get this
The mapping you can create from this looks like this
And the entities like this
So in the microflow you use to post and get your id's, you will have the following steps
1) Create the POST call, response should be based on the mapping and you can store the variable in the Root.
2) Retrieve the IDs object via association (because it is all non persistable)
3) Retrieve the List of values via association (because it is all non persistable)
4) Count the number of values to make sure about the result
5) create decisions for alternate flows in case of no or multiple responses
6) use the Head List Operation to get the first record from the Values list.
Now you have the 1 object with the ID as a value, that you can then use in logic to store in an attribute or the selected entity/object.
Make sure to use an error flow as well to allow custom error handling.
I want to post that Post ID into this $root/salesperson id which i am not able to do by using import mapping and string variable
Create a Microflow:
Add Input Parameter:
Retrieve the User by Name:
User entity or any other entity that stores user information.
Get the User ID:
Save ID to a Variable:
Return the User ID:
Call the Microflow:
Adapt this example based on your data model and requirements. This is a basic structure to help you understand the concept. Make sure to handle potential scenarios where the user with the given name may not exist or where multiple users have the same name, depending on your application's logic.
** You can reach out to me if you get stuck in any step.
This is my domain model were root is post api. In usernameID I'm passing the currect user name and through post api username is converted into id.
I want that id should be equal to salesperson_master_id in root.
this the post of root