cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

What means [@VariableName] syntax?

Hello,

 

I'd like to ask you the meaning of [@VariableName]  syntax and which is the difference with normal VariableName?

 

Thank you

7 REPLIES 7
Super User
Super User

Re: What means [@VariableName] syntax?

Hi @Anonymous

The technical name for the @ symbol infront of VariableName is the 'global disambiguation' operator. An @ symbol infront of a variable will always return the value of the global variable.

On a screen for example, let's say we set a global variable with the Set function, and a context variable with the UpdateContext function. In both cases, we provide the same variable name (MyVariable).

Set(MyVariable, "Tim"); 
UpdateContext({MyVariable:"Mr Dang"})

In this example, [@MyVariable] would return "Tim", whereas MyVariable would return "Mr Dang".

 

 

Highlighted
Anonymous
Not applicable

Re: What means [@VariableName] syntax?

Thnk you for your reply.

 

OK, now I understand why my pager not works.

 

I declared a variable in screen OnVisible with Set:

 

 

Set(myParams, {pageIndex:0, [...other params]})

And on OnSelect of next page button I wrote:

 

 

 

UpdateContext({myParams:Patch(myParams,{pageIndex:myParams.pageIndex+1})});[...other refresh result code]

 

So now I have two different myParams variable with the same name but different values.

 

Is possible to use Patch function without UpdateContext?

 

Thank you

 

Super User
Super User

Re: What means [@VariableName] syntax?

Yes, it's possible to call Patch without nesting it inside a call to UpdateContext.

 

Anonymous
Not applicable

Re: What means [@VariableName] syntax?

How it should be the function?

I've tried the following but not works:

Patch(myParams,{pageIndex:myParams.pageIndex+1})
Super User
Super User

Re: What means [@VariableName] syntax?

Hi @Anonymous

Could you clarify a bit more as to what you're trying to acomplish here, particularly on how you want to reset the pager? I assume that's why you're resetting a variable on the OnVisible of your screen? Is there any reason why you couldn't just use a single variable to do this, rather than 2 variables?

Community Support Team
Community Support Team

Re: What means [@VariableName] syntax?

Hi @Anonymous,

 

Just from the testing, it seems currently Patch() function will not work with Variables, patch() function currently could work with Collection, Data source, but not for Variables, even the variable is defined as a table value.

So if here you would like to take use of the Patch() function, then please consider switch the Set(Variable, value) with collect() or ClearCollect() function.

For Example:

 

Clearcollect(MyParams,{Record})

Then use patch to update its value with the format below:

 

 

Patch(MyParams, first(MyParams), {UpdateValue})

If here you prefer to use variable, to update the variable value, please consider switch to:

 

Set(MyParams, {Value})

Note here, if you use the Set() function, for the {Value} part,  the whole record should be entered, even if there is no changes for the related fields.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TopShelf-MSFT
Level 10

Re: What means [@VariableName] syntax?

Thanks for your help with this thread @timl and @v-micsh-msft 

 

@Anonymous can you review the updated information and advise?

 

@TopShelf-MSFT

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,135)