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 Apps
Suggested Answer

File Upload Issue

(0) ShareShare
ReportReport
Posted on by 12

I encountered an issue with file uploading in the code below. I tried to fix it, but I still encountered an error.

I am using Power Automate to create a flow for storing files, but I believe the issue might be caused by my code.

Error:

  1. The function 'Run' has some invalid arguments.
  2. Invalid argument type (Record). Expecting a Number value instead.
If(
    IsBlank(TextInput_ProjectName.Text) || IsBlank(TextInput_CostCenter.Text) || Dropdown_BUCode.Selected.Value = "--- โปรดเลือก ---",
    Notify(
        "กรุณากรอกข้อมูลที่จำเป็น",
        NotificationType.Error
    ),
    Set(
        recRecord,
        Patch(
            tb_Data_Request_List,
            Defaults(tb_Data_Request_List),
            {
                Title: TextInput_ProjectName.Text,
                'Project Conditions': TextInput_Conditions.Text,
                'BU Code': Dropdown_BUCode.Selected,
                Language: Dropdown_Language.Selected,
                'Campaign Type': Dropdown_CampaignType.Selected,
                Sender: Dropdown_Sender.Selected,
                'Target Audience': Concat(
                    Combobox_TargetAudience.SelectedItems,
                    Value,
                    ", "
                ),
                'Project Start': DatePicker_ProjectStart.SelectedDate,
                'Project End': DatePicker_ProjectEnd.SelectedDate,
                'Owners of SMS': TextInput_Owners.Text,
                'Send Date': DatePicker_SendDate.SelectedDate,
                'Send Time': Dropdown_SendTime.Selected,
                'Cost Center': TextInput_CostCenter.Text,
                'Qty Lead EN': Value(TextInput_QtyLeadEN.Text),
                'Word for English': TextInput_WordSMSEn.Text,
                'Qty Lead TH': Value(TextInput_QtyLeadTH.Text),
                'Word for Thai': TextInput_WordSMSTh.Text
            }
        )
    );
    Set(recID, recRecord.ID);

    ForAll(
        DataCardValue51_1.Attachments,
        VVICDataRequestSaveAttachmentFile.Run(
            recID,
            {
                file: {
                    contentBytes: Value,
                    name: Name
                }
            }
        )
    );
    // รีเซ็ตค่าของทุก Control
    Reset(TextInput_ProjectName);
    Reset(TextInput_Conditions);
    Reset(Dropdown_BUCode);
    Reset(Dropdown_Language);
    Reset(Dropdown_CampaignType);
    Reset(Dropdown_Sender);
    Reset(Combobox_TargetAudience);
    Reset(DatePicker_ProjectStart);
    Reset(DatePicker_ProjectEnd);
    Reset(TextInput_Owners);
    Reset(DatePicker_SendDate);
    Reset(Dropdown_SendTime);
    Reset(TextInput_CostCenter);
    Reset(TextInput_QtyLeadEN);
    Reset(TextInput_WordSMSEn);
    Reset(TextInput_QtyLeadTH);
    Reset(TextInput_WordSMSTh);
    Notify(
        "Request Submitted Successfully!",
        NotificationType.Success
    );
    Navigate('Home Screen')
)
 
 
Categories:
I have the same question (0)
  • MS.Ragavendar Profile Picture
    4,991 Super User 2025 Season 2 on at
    Hi,
     
    From the error Expecting a Number value instead, we understand in the power automate you created a parameter of Number but you passing string value so it cannot able to process.
     
    Lets tweek this 
     
     VVICDataRequestSaveAttachmentFile.Run(
                recID)
    to
     
     VVICDataRequestSaveAttachmentFile.Run(
               Value(recID)
    )
     
    Hope this solve your issue!
  • Suggested answer
    runatthakorn Profile Picture
    12 on at
    @MSR@08012015 Thank you for your answer. I have followed your advice, but I am still encountering the same issue.

    1. The function 'Run' has some invalid arguments.
    2. Invalid argument type (Number). Expecting a Record value instead.
     
        ForAll(
            DataCardValue51_1.Attachments,
            VVICDataRequestSaveAttachmentFile.Run(
                Value(recID),
                {
                    file: {
                        contentBytes: Value,
                        name: Name
                    }
                }
            )
        );
  • MS.Ragavendar Profile Picture
    4,991 Super User 2025 Season 2 on at
     
    Can you please share your power automate snippet?
  • runatthakorn Profile Picture
    12 on at
    @MSR@08012015 My Power Automate flow.
     
  • MS.Ragavendar Profile Picture
    4,991 Super User 2025 Season 2 on at
    Hi,
     
    Just try this out below it will works, You created first parameter as file and next as number but passing the values in the wrong order.
     
    Kindly revert me if doesn't resolve.
     
    ForAll(
            DataCardValue51_1.Attachments,
            VVICDataRequestSaveAttachmentFile.Run(
                {
                    file: {
                        contentBytes: Value,
                        name: Name
                    }
                },
                Value(recID)
            )
        );
     
     
  • runatthakorn Profile Picture
    12 on at
    @MSR@08012015  I followed your recommendation, but I still encountered an error.
     
    Error: Missing column. Your formula is missing a column 'contentBytes' with a type of 'Blob'.
     
    ForAll(
    DataCardValue51_1.Attachments,
    VVICDataRequestSaveAttachmentFile.Run(
    {
    file: {
    contentBytes: Value,
    name: Name
    }
    },
    Value(recID)
    )
    );
  • Suggested answer
    runatthakorn Profile Picture
    12 on at
    @MSR@08012015  I have solved the problem with the code below.
     
    ForAll(
    DataCardValue51_1.Attachments,
    VVICDataRequestSaveAttachmentFile.Run(
    {
    contentBytes: Value,
    name: Name
    },
    Value(recID)
    )
    );

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard