I have two Power Automate flows.
The first flow is named PA1, and it saves a string variable inside a SharePoint list under a column called Calculated_Result, as shown in the screenshot below.
In the second flow (PA2), I want to use this SharePoint list by retrieving the most recently added row. However, in the Get Item action, I have specified ID : 1, [See screenshot Below] but I actually want to retrieve the latest record of calculated_Result column from the SharePoint list and not just the first record.
In the HTTP connector action, I have a JSON payload where I want to pass the value of a SharePoint list column called 'calculated_Result'. Also i used power apps action at beginning of flow, its because i want to pass both power apps input + sharepoint list input to my http connector.
Note:
If I use Get Items instead of Get Item, it goes into an Apply to each loop, and the Parse JSON action is not able to parse the JSON because the HTTP connector is inside the Apply to each loop. Even if I use Parse JSON inside Apply to each, I cannot use the Initialize Variable action inside it, as it shows an error stating that the Initialize Variable action should be used at the topmost level.
How can i fix this?
@Sundeep_Malik Hey, thanks for the reply. it works!
Hey @Jupyter123
Dont use get item, use get items and keep its order by and top count conditions as below:
This will order your list in descending order of created date and time so the latest entry in the table. Then top count 1 will take out only 1 value from it.
Then use a compose inside it and add a similar condition as below:
I hope this helps 🙂