Can we implement the dictionary concept in PA desktop preview
Hello @soumiya,
Could you please clarify what you mean by "dictionary concept"? If you are referring to dictionary variables then PAD preview does have similar functionality of a dict variable in the form of DataRow variable.
Thanks for your reply...
@adijain I am referring to dictionary concept of getting the value based on key eg: config(URL) will return me the URL that is present excel.
Regards
Soumiya
@soumiya Thanks for the clarification. Yes, similar functionality is available in PAD in the form of a DataRow. E.g. lets say you have a DataRow variable called %row% with columns "Name" and "URL" and their values as "Microsoft" and "www.microsoft.com" respectively. Then, calling the variable %row["URL"]% will give you the value "www.microsoft.com" and %row["Name"]% will give "Microsoft". Hope it makes sense.
Thanks for your support @adijain
But when i call %row[Microsoft]% it should return me as www.microsoft.com
Is this possible
I think this is an interesting topic!
@adijain Means we can use the data table header as the key and the first row as the value. Or simply just 1 row of data table.
But in this case, how to create a "datarow" that is so dynamic which can increase and decrease on columns?
And currently, this "datarow" has to come from an actual Excel, right? Is there any way to create the "datarow" from thin air? 🙂
Hi @HellitonWoo
Datatables are the output of several PAD Actions, like "Read from Excel", "Read from CSV", "Extract data from web page", "Extract data from window".
Creating datatable variables from scratch is not yet available, but certainly in our roadmap.
I hope the above makes sense.
Hi Team,
Creating datable is possible but converting it into datarow is again a difficult task in PAD. Please help me out on this.
Thanks in advance.
I thought if you had a DataTable, %DataTable[0]% is your first data row. Am I missing something? Maybe I’m not understanding the question.
If I have a table in excel like
Name Age
X 10
y 20
When i get the value into %datatable%, i need to search the age of X(dynamically) instead of searching with index for eg: i need to search %datatable[x]% instead of %datatable[0]%
I don't know how many rows you have, but if not too many, something like a For Each %CurrentItem% which I believe when put to a datatable means per row, if %CurrentItem[0]% = "X", then Do something. It's a long work around, but it will get the job done.
On the other hand, you could put the datatable into excel and might actually be faster to get what you need there through Vlookups or VBA.
Best of luck!
try this way to see if it suits you, you can go adding objects to the list, then you can loop through the list.
Hello @soumiya
The following document describe how to declare a custom object in PAD.
Variable data types - Power Automate | Microsoft Docs
Custom object – Contains pairs of properties and values, which can be easily converted to JSON format.
To create a new Custom object, use the Set variable action and an epxression of the following structure: %{ 'Property1': 'Value1', 'Property2': 'Value2', 'Property3': 'Value2' }%.
For instance, I set Key-Value pairs to variable %URL% as below screenshot.
%{ 'Microsoft': 'https://www.microsoft.com/', 'Windows': 'https://www.microsoft.com/windows/', 'Azure': 'https://azure.microsoft.com/' }%
As a result, now you have Custom object having 3 pairs of Name and Value as below.
Then, you can retrieve the url of Microsoft as: %URL['Microsoft']%
Thank you.
Late to community,
Maybe this will help, working solution
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.