cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JDofficial
Frequent Visitor

Using Functions in Variables within Power Automate Desktop

Cheers,

 

I tried to dig up the internet without success for finding a solution to use (for example) text functions when assigning value to a variable.


At a 'set variable' action I have set: NewVar to 210121 (the date of the query). In the other stage I would like to set variable YearVar to something like "20" & Left(%NewVar%, 2). Unfortunately nothing like that seems to be working.

Is there a way to use functions within variables or inputs to actions in any fashion - apart from using the 'Get subtext' action? In a software where you can scrape whole tables from the web with css identification in a few clicks, I think it would be really lame to use a separate action for a simple text function.

 

PLEASE DO NOT COME UP WITH SOMETHING LIKE WHY I NEED THAT - bc I could use another tools or the whole thing is superfluous in the process, as I am still trying to find out what this software can do - because of the somewhat inappropriate documentation.

 

Thanks,
JD

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JDofficial ,

I totally agree with your view that if in a sophisticated programming language some logic/code can be incorporated with just 1 line of code, why it would not be possible to have it in another language/platform? As of now, in PAD it is not possible to call those ".net framework" based functions straight away. You can call it serious limitation/restriction.

 

An alternative to this can be activites like "Run VB Script" or "Run Python script", in which you can writedown really detailed piece of code in just 1 instruction.

 

Also in my opinion, having some restrictions in platform could be well though off by the developers of it. In case of PAD, I have observed one thing is that the chances error/failure of a piece of automation are significantly less compared to any other platform. Because your code is made up from only those activity allowed by software and not from user preffered library dependent functions/instructions. The more free environment it is the less error proofing done at design time or more error checking has to be done at run time. and at run time the chances of error/exception increases lot so the chances of execution break up in run time are higher.

 

I have been using other industry leader RPA tools since now almost 3 years. and one thing i have experienced is that you need to invest lot of time behind checking and testing of automation before deploymebt if your developmenet environment is so-called Open. in case of PAD this time could be significantly lower.

 

This doesn't mean that I don't want any changes or addition in platform. There are lot of improvement scope for it, which are being mentioned on the forum like this.

 

So the bottom line could be just find a way to actualize your code within the restriction of the software platform and then compare one platform with another platform in terms of performance.

View solution in original post

5 REPLIES 5
sakula1996
Responsive Resident
Responsive Resident

Hi @JDofficial ,

 

* Convert the number to text

* Use "Get Subtext" action to get subtext

* Then  add 20 infront of the subtext output

 

Hope this helps:)

 

 

sakula1996_0-1611339910952.png

 

sakula1996_1-1611339936196.png

sakula1996_2-1611339956206.png

 

sakula1996_3-1611339970200.png

 

 

Thank you @sakula1996, but my question was:

"Is there a way to use functions within variables or inputs to actions in any fashion - apart from using the 'Get subtext' action?"

 

Since you used it, I cannot accept it as a solution. I am completely aware of the opportunity of doing this (see my original post), but I find pretty awkward to do something similar in 3 actions instead of one line of code.

Hi @JDofficial ,

I totally agree with your view that if in a sophisticated programming language some logic/code can be incorporated with just 1 line of code, why it would not be possible to have it in another language/platform? As of now, in PAD it is not possible to call those ".net framework" based functions straight away. You can call it serious limitation/restriction.

 

An alternative to this can be activites like "Run VB Script" or "Run Python script", in which you can writedown really detailed piece of code in just 1 instruction.

 

Also in my opinion, having some restrictions in platform could be well though off by the developers of it. In case of PAD, I have observed one thing is that the chances error/failure of a piece of automation are significantly less compared to any other platform. Because your code is made up from only those activity allowed by software and not from user preffered library dependent functions/instructions. The more free environment it is the less error proofing done at design time or more error checking has to be done at run time. and at run time the chances of error/exception increases lot so the chances of execution break up in run time are higher.

 

I have been using other industry leader RPA tools since now almost 3 years. and one thing i have experienced is that you need to invest lot of time behind checking and testing of automation before deploymebt if your developmenet environment is so-called Open. in case of PAD this time could be significantly lower.

 

This doesn't mean that I don't want any changes or addition in platform. There are lot of improvement scope for it, which are being mentioned on the forum like this.

 

So the bottom line could be just find a way to actualize your code within the restriction of the software platform and then compare one platform with another platform in terms of performance.

View solution in original post

Hi @Rkmatieda,

 

Thank you for the ideas you have given - using Python or VBScript as an alternative. I find it is still not ideal, but better off having tons of actions that cannot be renamed and be put in context especially when automating more complex processes. As seemingly this is the best choice in the current framework I give you the credit for that.

 

Your reasoning, which I think is pretty close to the developers' official one, is fair and for now we have to live with it - I really hope only for now - as future development is going to iron out these flaws.

 

To reiterate: I also do think that PAD has really powerful tools like extract data from web page - but it is really dissonant that getting a subtext of a string is equally weighted as a process step to scraping a whole table. On the reliability part I find its behavior weird sometimes (like sometimes it does not run properly if an instance of a browser is not open yet) - but that is an other subject. In theory .NET is also developed by Microsoft, so I see no major challenge on the reliability here - the knowledge is within the organization. Strategically I deem there is a complete different story.

 

Cheers,

JD

wszreiber
New Member

with date is method with math

for example, if u wanna cut day number from 210121

when day is last digits: (210121 - day from date) / 100   = 2101

 

/vviesio

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,951)