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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set function not worki...
Power Apps
Unanswered

Set function not working after I exported a functional package in 1 login domain and then imported to different login domain- both login domain in same powerapps tenant id

(0) ShareShare
ReportReport
Posted on by 43

Greetings 

1. I am working in an environment of 1 powerapps tenant id with two user login ids , id 1 and id 2.

2. I had developed a fully functional app using id1.  I had to migrate the functional  apps developed in login id1 domain to the login id2 domain. I did this using the Export and Import Package functions of Powerapps and no errors were encountered in both processes. 

3. However, when I tried to run the Powerapps in id2 domain, I found that the Set function was not working properly, i.e. nothing was set for the global variables at OnStart Application. When I used the text label to troubleshoot, I found that blank was returned for all global variables  which means nothing was set.  Note that the global variables I am trying to set were email and display name and which were able to be displayed when I used another text label to check.

 

I tried deleting the Set variable statement and retyped again, Saved and Republished it. Also did a Run On Start but all these didnt work.  Is there something that is missing which I didnt do? Please help. This is really frustrating. 

 

Best regards

 

Jo

 

 

Categories:
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jo_25 Could you share the code you have in OnStart().

  • Jo_25 Profile Picture
    43 on at

    Hi, CNT 

     

    Thanks for reaching out. Here is the code 

    Set(_myemail,Office365Users.MyProfile().Mail);
    Set(varName,Office365Users.MyProfileV2().displayName);
    Set(_myProfile,Office365Users.MyProfile());
    Set(_leaveStart,Now());
    Set(_leaveEnd,Now());
    Set(_requestedDays,0);

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jo_25 When you say "I had to migrate the functional  apps developed in login id1 domain to the login id2 domain."

    do you mean moving the App from one Environment to the other? In any case a simple Set statement should work. Did you try something like, Set(myName, "Jo")

  • Jo_25 Profile Picture
    43 on at

    Hi, CNT 

    Thanks for reaching out. I don't quite understand the question on environment. I am on the same tenant id for both app except that one of the apps was in 1 domain - called it the x domain that requires 1st set of id for login and the other was in another domain that requires a 2nd but different set of id to login. Both apps were however on same tenant id.

     

    I did a simple Set statement and then use the text input to display myName but blank was displayed. I also look at the Global variables link in Powerapps for that the problem app and they are all null whereas that for the working apps was showing the collect values set for the variables. Not sure what is going on. Please help!!!

     blankset.PNG

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jo_25 In your Tenant you can have any number of domains and logins. You don't need a separate App for each domain. But with a Tenant you can have more than one Power App Environments (see below) and in each Environment you can have n number of Apps. It is important you understand this concept, https://docs.microsoft.com/en-us/power-platform/admin/environments-overview

     

    CNT_0-1624003159875.png

     

  • Jo_25 Profile Picture
    43 on at

    Hi, CNT

    Thanks for reaching out and providing me the documentation about different environments.  Its a good read. Actually, the migration of my apps from 1 login domain to another login domain is actually importing the apps that I exported and which was developed in our internet site (in cloud) available to our users to our intranet site (in cloud but have a different login) and not moving it from sandbox environment or test environment to a production environment as stated in the documentation.  We do not have any test and development environment set up. So therefore whatever developed is in production environment. I am really at a loss what to do now as the entire apps now does not work after I migrated and then reconnect it to a new team site but with the sharepoint lists having the same names as the first team site used to develop the working powerapps. Would appreciate your guidance or anyone on this. Many thanks in advance. 

     

    Best regards 

     

    Jo_25 

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jo_25 As I understand you have only 1 Tenant and 1 Power Apps Environment within the Tenant. In this tenant you may have have set up custom domains (mycompany1.com, mycompany2. com...) and users may login using different domain names. But that should not affect you PowerApps or Sharepoint Lists. You had mentioned about Exporting and Importing. Could you please explain from where you are Exporting (and what) and where are you Importing it to Screen shot would be helpful)?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard