web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How create my Variable
Power Apps
Unanswered

How create my Variable

(0) ShareShare
ReportReport
Posted on by

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

)

);

Categories:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    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.

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    @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
     )
    );

     

  • BusyIntelligence Profile Picture
    321 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard