Help! I am experiencing different results when I run an app in studio and then immediately turn around and run the published copy of it. I know I am running the same version because if I try to publish, it shows that the version I just ran in studio is already published.
When I run it in studio, it behaves correctly. There is one record for me in a Sharepoint list. It finds that record and displays it. There are several debug fields at the bottom of the screen to try to help me figure out what is happening. You will notice that CheckLoad is 1. This is a row count of the number of times my email address appears in the collection which populates the gallery. You'll also see CountRows is 1, which is the check used to determine if there are any records present for me. When 0, it will add a record for me. The code in the OnStart and the OnVisible of the home page are both at the bottom of this message.
So, to reiterate, when I run this in studio, I get the result I would expect to see.
THIS SCREEN SHOT FROM INSIDE STUDIO.
When I run the app outside of studio, it is patching a new record every time in error. What seems to be happening is the OnVisible of the HomePage is executing BEFORE the OnStart is executing. I can tell this based on a couple things:
1. The home page initially opens with no record displayed. The Debug Message "About to Patch ResourcesDev" then populates almost immediately and the gallery then shows one record - the record it just told me it as about the patch.
2. AFTER THIS, the CheckLoad value (which is set so I can debug near the end of the OnStart) populates and is set to 2 because it is now loading both the original record that was already there and should have loaded and the newly patched record.
THIS SCREENSHOT IS FROM OUTSIDE STUDIO and shows the wrong behavior. with two records instead of one.
Question: Shouldn't the OnStart be completing before the OnVisible of the default screen starts - the behavior seen in Studio? I thought for a minute the issue it might be due to the fact I had the load of the collection in OnStart inside a concurrent but I moved it out and the behavior is the same.
Here's the related code from the OnStart, OnVisible of the default screen, and the Gallery (although that isn't really the source of the problem).
OnStart:
Set(
CurrentUserEmail,
User().Email
);
ClearCollect(colResources, ResourcesDEV);
ClearCollect(colCopyResources, ResourcesDEV);
ClearCollect(colRoster, ConsultingRoster);
Set(CheckLoad, CountRows(Filter(colResources, Email4Resource = CurrentUserEmail)));
ForAll(colCopyResources,
Patch(colResources,
First(Filter(colResources, ID = ID)),
{ConsultantCountry : LookUp(colRoster, Email4Resource = ConsultantEmail).CountryName,
ConsultantLocation: LookUp(colRoster, Email4Resource = ConsultantEmail).LocationHierarchy,
ConsultantPractice: LookUp(colRoster, Email4Resource = ConsultantEmail).Practice,
ConsultantSubpractice: LookUp(colRoster, Email4Resource = ConsultantEmail).Subpractice,
ConsultantRole: LookUp(colRoster, Email4Resource = ConsultantEmail).Role,
ConsultantRegion: LookUp(colRoster, Email4Resource = ConsultantEmail).RegionName
})
);
I have only provided the portion of the OnStart that deals with the Resources list -- there is a lot more in the OnStart setting up other collections. You'll notice where the CheckLoad debug value is set. I can provide the rest if needed, but it all deals with other collections.
OnVisible of HomePage:
Set(PopUpVisible1, false);
If(RMAdmin = "Global", Set(AskRegion, true), Set(AskRegion, false));
If(IsBlank(CurrentUserEmail),Set(CurrentUserEmail, User().Email));
If(Demo3,
Set(CurrentUserEmail, "Steve.Schutter@teradata.com");
Set(CurrentUserName, "Steve Schutter");
Set(CurrentUserDisplayName, "Schutter, Steve");
Set(IsRM, false);
Set(RMAdmin, ""));
If(MgrAsIndividual, 1=1,
!IsRM,
ClearCollect(DirectReports,Office365Users.DirectReportsV2(CurrentUserEmail).value);
If(CountRows(DirectReports) = 0,
Set(IsMgr, false);
If(CountRows(Filter(colResources, Email4Resource = CurrentUserEmail)) = 0,
Set(UserDetails, LookUp(ConsultingRoster, ConsultantEmail = CurrentUserEmail));
If(IsBlank(UserDetails.RegionName),Set(PopUpVisible1, true);Reset(txtQLID),
Set(DebugMsg, "About to patch ResourcesDev");
//* Patch in the new item in the Sharepoint List
Patch(ResourcesDEV, Defaults(ResourcesDEV),{Title: CurrentUserDisplayName, Email4Resource: CurrentUserEmail, LastUpdateDate: Today(), QuicklookID: UserDetails.Title,
ConsultantCountry: UserDetails.CountryName, ConsultantPractice: UserDetails.Practice, ConsultantSubpractice: UserDetails.Subpractice,
ConsultantRole: UserDetails.Role, ConsultantRegion: UserDetails.RegionName, ConsultantLocation: UserDetails.LocationHierarchy});
//* Then patch a copy into the collection which has already been loaded
Patch(colResources, Defaults(colResources),{Title: CurrentUserDisplayName, Email4Resource: CurrentUserEmail, LastUpdateDate: Today(), QuicklookID: UserDetails.Title,
ConsultantCountry: UserDetails.CountryName, ConsultantPractice: UserDetails.Practice, ConsultantSubpractice: UserDetails.Subpractice,
ConsultantRole: UserDetails.Role, ConsultantRegion: UserDetails.RegionName, ConsultantLocation: UserDetails.LocationHierarchy});
Set(SelectedEmail, CurrentUserEmail);
Set(SelectedName, CurrentUserName);
Reset(txtQLID));
Set(UserFound,true),
Set(UserFound,true)
),
//* Do not include indirect reports (toggle set to No)
togIndirect.Value = false,
ClearCollect(AllReports, DirectReports);
Set(IsMgr, true),
//* Include indirect reports is set to true (toggle set to yes)
Clear(IndirectReports);
Set(IsMgr, true);
ClearCollect(AllReports, DirectReports);
ForAll(
AllReports,
Collect(IndirectReports, Office365Users.DirectReportsV2(mail).value)
);
Set(NumFound, CountRows(IndirectReports));
If(NumFound = 0, 1=1,
Collect(AllReports,IndirectReports);
)
)
);
If(IsRM, Set(LimitRegion, RMRegion),Set(LimitRegion, LookUp(colResources, Email4Resource = CurrentUserEmail).ConsultantRegion));
If(LimitRegion = "Global",
ClearCollect(
colCountries,
Sort(
RenameColumns(
ShowColumns(
Filter(
Distinct(ConsultingRoster,CountryName),
Result <> ""
),
"Result"
),
"Result",
"CountryName"
),
CountryName
)
),
ClearCollect(
colCountries,
Sort(
RenameColumns(
ShowColumns(
Filter(
Distinct(
Filter(
ConsultingRoster,
LimitRegion = RegionName
),
CountryName
),
Result <> ""
),
"Result"
),
"Result",
"CountryName"
),
CountryName
)
));
Patch(
colCountries,
Defaults(colCountries),
{CountryName: " None selected"}
);
Clear(colCountryNGeo);
Collect(
colCountryNGeo,
colCountries
);
If(ReturnfromDetail, 1=1,
Reset(txtName);
Reset(txtCountry);
Reset(txtKeyword);
Reset(txtRole);
Reset(txtPractice);
Reset(txtSubpractice),
Reset(txtArea);
Reset(txtLocation);
Reset(txtClearance);
Reset(ddCitizenship);
Set(ReturnfromDetail, false));
The following values used in the OnVisible have been confirmed with debug labels.
IsMgr is false.
RMAdmin is blank
IsRM is false
MgrAsIndividual is false.
Demo3 is false.
And finally, the gallery code which falls down to the last 4 lines, based on the values of the global variables just provided.
If((IsRM && RMAdmin = "Global" && ddAskRegion.Selected.Value <> "Per Profile") ||
(IsRM && RMAdmin = "Region" && togPerProfile.Value = false) ||
(IsRM && togExpandSearch.Value = true),
SortByColumns(
AddColumns(
Filter(AddColumns(colResources, "ConsultantArea",
If(Left(ConsultantCountry,13) = "United States" && IsBlank(ConsultantLocation), "AMS North America", Left(ConsultantCountry,13) = "United States",
LookUp(colGeo, ConsultantLocation = d0rf && ConsultantRegion = Title).Geo,
LookUp(colGeo,ConsultantCountry = Geo && ConsultantRegion = Title).Area)),
RMRegion = ConsultantRegion,
If(IsBlank(txtName.Text), 1=1, txtName.Text in Title || Upper(txtName.Text) in Upper(QuicklookID)),
If(txtArea.Selected.Result = " None selected", 1=1,
ConsultantLocation in Filter(Filter(colGeo,txtArea.Selected.Result = Area).d0rf,!IsBlank(d0rf)) ||
ConsultantCountry in Filter(colGeo,txtArea.Selected.Result = Area).Geo),
If(txtCountry.Selected.CountryName = " None selected", 1=1, ConsultantCountry = txtCountry.Selected.CountryName) ||
(!IsBlank(ConsultantLocation) && ConsultantLocation in Filter(colGeo,txtCountry.Selected.CountryName = Geo).d0rf),
If(txtLocation.Selected.Result = " None selected", 1=1, ConsultantLocation = txtLocation.Selected.Result),
If(txtPractice.Selected.Result = " None selected", 1=1, ConsultantPractice = txtPractice.Selected.Result),
If(txtSubpractice.Selected.Subpractice = " None selected" || IsBlank(txtSubpractice.Selected.Subpractice), 1=1,
ConsultantSubpractice = txtSubpractice.Selected.Subpractice),
If(txtRole.Selected.Role = " None selected", 1=1, ConsultantRole = txtRole.Selected.Role),
If(IsBlank(txtKeyword.Text),1=1, txtKeyword.Text in Keywords),
If(ddCitizenship.Selected.CountryName = " None selected", 1=1, ddCitizenship.Selected.CountryName in Citizenship),
If(IsBlank(txtClearance.Text),1=1, txtClearance.Text in Clearance)),
"FirstName", Mid(Title,Find(" ",Title) + 1),
"LastName",Left(Title,Find(" ", Title) - 2)),
"LastName"),
IsRM,
SortByColumns(
AddColumns(
Filter(AddColumns(colResources, "ConsultantArea",
If(Left(ConsultantCountry,13) = "United States" && IsBlank(ConsultantLocation), "AMS North America", Left(ConsultantCountry,13) = "United States",
LookUp(colGeo, ConsultantLocation = d0rf && ConsultantRegion = Title).Geo,
LookUp(colGeo,ConsultantCountry = Geo && ConsultantRegion = Title).Area)),
RMRegion = ConsultantRegion,
If(ContainsSpecial, 1=1, Left(ConsultantCountry,13) = "United States", ConsultantArea in colGeoFilter.RMGeo, ConsultantCountry in colGeoFilter.RMGeo),
If(IsBlank(txtName.Text), 1=1, txtName.Text in Title || Upper(txtName.Text) in Upper(QuicklookID)),
If(txtArea.Selected.Result = " None selected", 1=1,
ConsultantLocation in Filter(Filter(colGeo,txtArea.Selected.Result = Area).d0rf,!IsBlank(d0rf)) ||
ConsultantCountry in Filter(colGeo,txtArea.Selected.Result = Area).Geo),
If(txtCountry.Selected.CountryName = " None selected", 1=1, ConsultantCountry = txtCountry.Selected.CountryName) ||
(!IsBlank(ConsultantLocation) && ConsultantLocation in Filter(colGeo,txtCountry.Selected.CountryName = Geo).d0rf),
If(txtLocation.Selected.Result = " None selected", 1=1, ConsultantLocation = txtLocation.Selected.Result),
If(txtPractice.Selected.Result = " None selected", 1=1, ConsultantPractice = txtPractice.Selected.Result),
If(txtSubpractice.Selected.Subpractice = " None selected" || IsBlank(txtSubpractice.Selected.Subpractice), 1=1,
ConsultantSubpractice = txtSubpractice.Selected.Subpractice),
If(txtRole.Selected.Role = " None selected", 1=1, ConsultantRole = txtRole.Selected.Role),
If(IsBlank(txtKeyword.Text),1=1, txtKeyword.Text in Keywords),
If(ddCitizenship.Selected.CountryName = " None selected",1=1, ddCitizenship.Selected.CountryName in Citizenship),
If(IsBlank(txtClearance.Text),1=1, txtClearance.Text in Clearance)),
"FirstName", Mid(Title,Find(" ",Title) + 1),
"LastName",Left(Title,Find(" ", Title) - 2)),
"LastName"),
IsMgr,
SortByColumns(
AddColumns(
Filter(colResources,
Email4Resource in AllReports.userPrincipalName || Email4Resource in AllReports.UserPrincipalName,
!IsBlank(Email4Resource),
If(IsBlank(txtName.Text), 1=1, txtName.Text in Title || Upper(txtName.Text) in Upper(QuicklookID)),
If(IsBlank(txtKeyword.Text),1=1, txtKeyword.Text in Keywords)),
"LastName", Mid(Title,Find(" ",Title) + 1),
"FirstName",Left(Title,Find(" ", Title) - 1)),
"LastName"),
AddColumns(
Filter(colResources,Email4Resource = CurrentUserEmail),
"LastName", Mid(Title,Find(" ",Title) + 1),
"FirstName",Left(Title,Find(" ", Title) - 1))
)
You can see where DebugMsg (displayed in the debug labels on the Home Page) is set. This is populating BEFORE CheckLoad in the OnStart is populating.
Why is this happening at all? Why is it happening when the app runs for real but not in studio? How do I get it to work correctly -- as it does in Studio?
I'm happy to share any other screen shots anyone might want or to capture video in Camtasia and post to better demonstrate what is happening.
Thanks in advance!
Solved! Go to Solution.
Hey there!
Have you checked your Advance settings option for "Use non-blocking OnStart rule". If you have that set on (which is default), it will run OnStart in parallel with other actions. If off, the app will wait for the OnStart to complete.
See if that is helpful.
Hey there!
Have you checked your Advance settings option for "Use non-blocking OnStart rule". If you have that set on (which is default), it will run OnStart in parallel with other actions. If off, the app will wait for the OnStart to complete.
See if that is helpful.
Many thanks Randy. No, I was not conscious of that setting and it was indeed the problem. I see a new blog topic being written on this tonight. Again, my thanks.
Always happy to help...sorry I've been so distant from the forum over the past couple months. Major project on the plate is finally coming to a close, so hopefully I'll have some more "answering" time shortly.
Dear Community Members, We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd. During this period, members will not be able to Kudo, Comment, or Reply to any posts. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!
We are excited to announce the Summer of Solutions Challenge! This challenge is kicking off on Monday, June 17th and will run for (4) weeks. The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities. Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”) - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024 Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods. You must enter into each weekly Entry Period separately. How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different. Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers. At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing. Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner. A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random. Individuals will be contacted before the announcement with the opportunity to claim or deny the prize. Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners. Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event. ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE** Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08 23 @WarrenBelz 31 @DBO_DV 10 @Amik 19 AmínAA 6 @mmbr1606 12 @rzuber 4 @happyume 7 @Giraldoj 3@ANB 6 (tie) @SpongYe 6 (tie) Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08 10@WarrenBelz 25 @DBO_DV 6@mmbr1606 14 @AmínAA 4 @Amik 12 @royg 3 @ANB 10 @AllanDeCastro 2 @SunilPashikanti 5 @Michaelfp 2 @FLMike 5 @eduardo_izzo 2 Meekou 2 @rzuber 2 @Velegandla 2 @PowerPlatform-P 2 @Micaiah 2 Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27 Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8 SunilPashikanti8
On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners. The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights. Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.
We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for. We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer. Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together. Here's to new beginnings and endless possibilities! If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport. To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages