cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
soumiya
Helper I
Helper I

Dictionary concept

Can we implement the dictionary concept in PA desktop preview 

13 REPLIES 13
adijain
Microsoft
Microsoft

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.

prasanna_m94
New Member

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!

Douglas_Lopes
New Member

Douglas_Lopes_0-1632933780891.png

try this way to see if it suits you, you can go adding objects to the list, then you can loop through the list.

 

Anonymous
Not applicable

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.


shindomo_0-1632947736375.png

 

%{ '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.

 

shindomo_1-1632948076807.png

 

Then, you can retrieve the url of Microsoft as: %URL['Microsoft']%

 

shindomo_0-1632949398267.png

 

Thank you.

Anonymous
Not applicable

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Top Kudoed Authors
Users online (3,184)