cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wht_629
Helper II
Helper II

Send Push Notification to Android mobile phone failed after created record in share point list

Dear All

            I have a Power apps connected to share point list, now I wanted to send push notification to a couple of users which used android mobile phone after I created a record in share point list successful , but there's nothing happen when I saved a new record into share point list .  I have below concerns:

           1. how to trigger an event to send Push Notification to mobile phone in an Apps ?

 

           2. which save mode we need to choose in order to send notification successful , Submit(Editform1) or use Patch function ?

 

           3. Push Notification to a single recipient or a couple of users , it's the same way ?

 

 Currently  I used patch function to do that, but failed, should I need change to use submit fucntion ?    here's my code in OnSelect property :

             Patch(EquipmentServiceRequest,LookUp(EquipmentServiceRequest,RequestNo=txtRequest.Text),

              {            LineNo: txtLineNo_Edit.Text,

                EquipmentNo: txtEquipment_Edit.Text,

                      ToolingNo: txtToolingNo_Edit.Text,

                FaultDescription: txtFaultDesc_Edit.Text

              });

              PowerAppsNotification.SendPushNotification(

              {

                 recipients: ["myName@xxx.com"],

                 message: "New Request has been assigned to you",

                 openApp: true

               }

  

             is my code miss something ? 

             thanks in advance if any help 

14 REPLIES 14
wht_629
Helper II
Helper II

I tried to find the posts here , and found seems like I missed a connector need to be added like below screenshot:

this  is my own data source :                                                           this was get from posts:

wht_629_1-1597628997290.png

 

wht_629_0-1597628914658.png 

 

I found I couldn't get the item which highlight in the post screen , anyone know how to add it to my own data source list ?

 

thanks!

v-xida-msft
Community Support
Community Support

Hi @wht_629 ,

Do you want to send a Push Notification after you submit an new record into your SP List?

 

Firstly, if you want to submit a new record into your SP List, you should modify your Patch formula as below:

Patch(
      EquipmentServiceRequest,
      Defaults(EquipmentServiceRequest),  // Modify formula here
      {
        LineNo: txtLineNo_Edit.Text,
        EquipmentNo: txtEquipment_Edit.Text,
        ToolingNo: txtToolingNo_Edit.Text,
        FaultDescription: txtFaultDesc_Edit.Text
      }
);

the Patch formula that you provided is used to update an existing record in your SP List, rather than, create a new entry in your SP List. You should make your whole formula look like below:

Set(
    SubmittedRecord,
    Patch(
      EquipmentServiceRequest,
      Defaults(EquipmentServiceRequest),  // Modify formula here
      {
        LineNo: txtLineNo_Edit.Text,
        EquipmentNo: txtEquipment_Edit.Text,
        ToolingNo: txtToolingNo_Edit.Text,
        FaultDescription: txtFaultDesc_Edit.Text
      }
    )
);
If(
   !IsBlank(SubmittedRecord),
   PowerAppsNotification.SendPushNotification(
              {
                 recipients: ["myName@xxx.com"],
                 message: "New Request has been assigned to you",
                 openApp: true
               }
   )
)

 

For your first question, if you want to send a Push Notification from a canvas app, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/add-notifications

 

For your second question, in order to submit a new record back to your SP List, the SubmitForm function and Patch function are both OK. If you use SubmitForm function, you must add a Edit form in your canvas app, then connect it to your SP List.

 

For your third question, please check the article I mentioned within the response to your first question.

 

The important thing you need to know is that the PowerAppsNotification connector is a action data source rather than table data source, so you could not connect it to a Edit form directly, you need to execute the following formula (inside On-behavior event property of a control) to send Push Notification:

PowerAppsNotification.SendPushNotification(...)

 

Regarding the need that you mentioned, I think the PowerAppsNotification connector may not be the best choice for your scenario. Currently, there are known limits with the PowerAppsNotification connector:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/add-notifications#known-limitations

As an alternative solution, you could consider add a Microsoft 365 Outlook connector in your canvas app to send Outlook email to your recipients.

Set(
    SubmittedRecord,
    Patch(
      EquipmentServiceRequest,
      Defaults(EquipmentServiceRequest),  // Modify formula here
      {
        LineNo: txtLineNo_Edit.Text,
        EquipmentNo: txtEquipment_Edit.Text,
        ToolingNo: txtToolingNo_Edit.Text,
        FaultDescription: txtFaultDesc_Edit.Text
      }
    )
);
If(
   !IsBlank(SubmittedRecord),
   Microsoft365Outlook.SendEmail(
                              "myName@xxx.com", // if want to send to multiple users, please concatenate multiple email addresses with ';' operator, e.g. User1@email.com;User2@email.com;..
                              "New Request has been assigned to you",
                              "New Request has been assigned to you"
   )
)

 

Please try above solution, then check if the issue is solved.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-xida-msft

          I updated my code as your proposals like below:

          

         Set(SubmittedRecord,Patch(EquipmentServiceRequest,Defaults(EquipmentServiceRequest),

               { PlantCode: dropdownPlant.Selected.Value,

                 RequestNo: txtRequestNo.Text,

                 CreatedBy: myUserInfo.UserName,

                 CreatedDate: DateTimeValue(txtCreatedTime.Text),

                  LineNo: txtLineNo.Text,

                  EquipmentNo: txtEquipmentNo.Text,

                    ToolingNo: txtToolingNo.Text,

                   FaultDescription: txtFaultDescription.Text,

                   RequestStatus: "New",

                   Title: "0" } ));

                    If(!IsBlank(SubmittedRecord),

                        PowerAppsNotification.SendPushNotification(

                         { recipients: [ "mymail@xxxx.com" ],

                           message: "New Request has been assigned to You"

                          }

                    );

                   Notify("Your Request Created Successful",Success,5000);

                   ResetForm(Form_NewItem);

                   Navigate(MainScreen_Leader,None),Notify("Created Request Failed, Please Check",Error,5000))

 

                 but seems still not any push information in my mobile phone (code runs ok, no any error message)

                 tomorrow will try to use ios phone to check

               

Hi @wht_629 ,

Just as I mentioned in previous reply, there are some known limits with the Power Apps Notification connector. Firstly, please make sure you have enabled the "Notification" option for the PowerApps Mobile App in your Android device, so the PowerApps Push Notification could be shown up in your mobile device.

 

Regarding the needs that you mentioned, I think the formula I provided above could achieve your needs. Please try it in your iOS mobile device, then check if same issue still exists.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft 

                       I tested on ios mobile phone, it works fine(iPhone could get the push notification), I also checked my Android phone settings, ensure push notification is allowed. so I think the code no problem, should be some settings missed on my Android phone, will try another android to test again.

Hi @wht_629 ,

Yeah, I think this issue is not related to the formula I provided above, it may be related to Mobile device settings.

 

Please try it in another Android device, then check if the notification could be received as expected. If the formula I provided above could solve your issue, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi, @WarrenBelz  ,@mdevaney

         Do you have any proposals ?

 

         I  tried to test on other android mobile phone , but still the same issue, I am sure I have enabled the "Notification" options for my apps.

 

HI @wht_629 ,

Have you upgraded the Power Apps Mobile App to the latest version?

 

Please check if you have upgraded the Power Apps Mobile App to the latest version, if not, please consider upgrade it to the latest version, then try your canvas app again, check if the issue is solved.

 

Also please consider try to uninstall PowerApps Mobile App from your Android device, and then re-install it again in your Android device, then check if the issue is fixed.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft 

 

I tried to upgrade my mobile phone android OS to latest version, changed another android phone to test even change another  brand (Hua Wei)  phone , but always the same issue, but I found my android power apps version is 3.20071.21, my ios phone power apps version is 3.20081.20 , it's newer than my android's version, so I tried to get latest version for my android phone, but not successful.

 

could you share with me a link to get latest version for android OS  ?

 

thanks!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,713)