cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RodzMaz81
New Member

How create my Variable

I would like to create a Variable that will return for me the division the site is from for example site Aeroton is a  Bakery(Division)

 

I already have a variable called varBranch that returns the site this information is in an external table called mas.branch and it returns the site with no issues using this function below

Set(
varBranch,
LookUp(
'[mas].[Branch]',
varBranchCode = POPCode,
POPName

)

);

 

 

However I have created another variable called varCategory/varDivision but still returns as blank maybe my function is incorrect may you assist please as the division or category is also found in the same table.My Function is as below

 

RodzMaz81_0-1629537413308.png

Set(

varDivision,

LookUp(
'[mas].[Branch]',
varBranch = Division,POPCode

)

);

3 REPLIES 3
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @RodzMaz81 ,

Is this code added in your App on start ? Are you trying check the value after you added this code in App start ?

If so please run the Run on start as mentioned below to check the value of the variable. As in the Edit mode the app on start will only when you open the app after that if you add any code in the app start you have run app start explicitly. 

PG_WorXz10_0-1629538067842.png

 

 

 

 Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

timl
Super User
Super User

@RodzMaz81 

I would double check the field names that you use in your call to LookUp.

For example, if you want to return the Division value from the first record from the [mas].[Branch] table where the POPCode value matches the value in varBranch, this is the syntax that you would use. Notice how you would pass Division as the third argument to LookUp .

 

Set(
    varDivision,
    LookUp(
          '[mas].[Branch]',
           varBranch = POPCode,
           Division
    )
);

 

I agree with @RodzMaz81 . Also check the variable type of varBranch.
If it's a record you can easily refer to varBranch.Division or varBranch.Category to get to other fields of that record.
That way you need less Lookup functions.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,010)