cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xeroxoo
Regular Visitor

OnStart Error

Trying to set variable onstart page but returns error of Invalid argument Type. 

 

Please Help

 

10 REPLIES 10
eka24
Super User III
Super User III

The first variable is not visible enough.

On the second variable, if you are returning a column, the last argument should be that column.

 

A further explanation could help expecially on the structure of the table.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

gabibalaban
Super User II
Super User II

@xeroxoo ,

User vartenant.'Account Name' on your second Set function.

 

Hope it helps !

xeroxoo
Regular Visitor

Thank you for your fast response. 
By the way, what do you mean by "not visible enough"?

 

I've include two tables from dynamics crm entity
Account = Tenants
Case = Tickets

In Ticket entity there's a field named "Tenant (new_tenant)" look up to Tenant Entity of "Account Name". I am trying to set a variable to enable the get the GUID. 

eka24
Super User III
Super User III

I meant I can't see the full formula for the first variable.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

xeroxoo
Regular Visitor

Set(vartenant,Tickets.'Tenant (_new_tenant_value)');
Set(vartenantid,LookUp(Tenants,'Account Name'= Tickets.'Tenant (_new_tenant_value)',vartenant))

yashag2255
Dual Super User II
Dual Super User II

Hi @xeroxoo 

 

This error is coming because the Account Name in Tenants is not matching the varTenant type. Can you follow the below steps:

 

1) Select View from the Top menu and Select Variables.

2) Open the variable and see the value. I am guessing that this is a table type value. Open the value from the purple table icon and locate where the value is.

3) Add that key in the formula to either 'Account Name'.ColumnName or varTenant.ColumnName.

 

Additional expression you can try if the variable is a single column table with only one row:

'Account Name' = First(varTenant).ColumnName

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Sorry I'm bit stuck after step 2. 

yashag2255
Dual Super User II
Dual Super User II

@xeroxoo 

 

Remove the second expression and paste it somewhere on a notepad. Now, from the tree view, click the three dots after App and click Run On Start, this should save some value in the variable and you can open it from the screen that you shared in the screenshot.

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Its working now!
But I wanted to set another variable from another data source that looked up to this vartenant. Could you also guide me with it?
For now:
Set(vartenant, Tenants.'Account Name');

I want to look up on another data source named Tickets, and the column named 'Tenants (_new_tenant_value)', which is a lookup filed to Tenants table, 'Account Name'.
I tried putting this in
Set(vartenantid,LookUp(Tickets.'Tenant (_new_tenant_value)' = vartenant))
but it gives error. 

Helpful resources

Announcements
PA 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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (24,178)