I want the value 1109,A,B,C should come for excel sheet and the values will change everytime so it will run in loop. After that i am using HTTPS request to get some data
String manipulation will work ? or any other approach
String manipulation can be a viable approach for extracting specific JSON values, especially when dealing with simple and consistent JSON structures. However, for more complex and dynamic scenarios, utilizing a dedicated JSON parsing approach offers greater robustness and error resilience.
Recommended Approach: Using Deserialize JSON Activity
This method offers flexibility and helps prevent issues that can arise from changing values or formats within the JSON.
Read JSON File
Deserialize JSON
Extract Values
Write to Excel
Loop: Wrap this process in a loop if you have multiple entries to process
HTTP Request: Once the values are saved to Excel, proceed with the HTTP request for further data retrieval.
instead of writing it in txt file can we skip that step and just process updated json directly to https activity because i will again need to read that file and process it further will that be possibile?
Sure you can do that
Then simply replace the Write Text File with your Http Request activity.
And if you have several lines in your Excel File, and want to execute an Http Request per row, then simply drag the activity below the For Each dt_ExcelData.Columns activity.
Yes, you can achieve this by creating a dynamic JSON string based on Excel data. Here’s a solution using UiPath that leverages string manipulation along with reading Excel data.
Step-by-Step Solution:
Read Excel Data:
Use the Read Range activity to read your Excel sheet into a DataTable (let’s call it dtData).
Loop Through Excel Data:
Use a For Each Row in DataTable activity to iterate through each row of dtData.
Construct JSON String:
Inside the loop, use an Assign activity to build a JSON string dynamically. For example: