How to put data from Dictionary to webpage

Hi Community,
I’ve a Dictionary (string, string) in which the data are as below:
Ghuge,Sarika : Jun 23, 40, Jul 23, 50
Yash: Jul 23, 30, Aug 23, 30, Sep 23, 40
Likewise…
where key of Dictionary is Ghuge Sarika, Yash and rest of the things are value.

I need to print the keys & values of dictionary in the respective sections of the webpage

such as,
for Resource the key should get printed and for Jun 23 it should get 40 hrs , for Jul 23 it should get 50 and so on for other keys of the Dictionary.

Please suggest some sol.
Thanks.

@siddhi

For getting the value use dict("Name").ToString and say save in value str

Now I see you have comma separated values

So create a string array of vararray = str.Split({","},Stringsplitoptions.None)

Please use a loop to access them like this

For loop with in argument as Enumerable.Range(0,Cint(vararray.Count/2)) and change type argument to integer

Inside the loop use vararray(Cint(currentitem*2)) to get date part

And to get the value use vararray(Cint(currentitem*2)+1)

Hope this helps

Cheers

@Anil_G ,

I need to use the output of dictionary for the web automation as I explained above for further click, type into etc activity.
So, will it work for that , please explain.

Thanks.

@siddhi

Inside the loop you can use thse values to use in the web application to type into

Cheers

@Anil_G
can you please send the steps in code i,e in xaml file

@Anil_G ,

Yes, please share the Xaml file of the above steps. It’ll be really very helpful.

Thanks.

@siddhi @Sarika13

Please check this

output:
image

Dictionories.xaml (10.2 KB)

cheers

2 Likes

thanks @Anil_G it help us.

further, how can we enter the hours of respective resource in the respective month in the given application
note : application always starts with current month.
for e.g : Ghuge,Sarika : Jun 23, 40, Jul 23, 50 , Aug 23, 120
So 40 hours should go in Jun 23 , 50 hours should go in jul 23 , 120 hours should go in Aug 23 and so on…

1 Like

@Sarika13

please check the selectors it looks like a table…so the selector should be containing the colname which would be jun 23 etc…use variable in place of that…and pass the value extracted from dictionary…and to fill the roe can be identfied by tablerow and I guess it would be constant everytime

cheers

@Anil_G can you please send the xaml code