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

Community site session details

Session Id :
Power Up Program - Building model-driven apps w...
Unanswered

This record hasn't been created yet. To enable image upload, create this record.

(0) ShareShare
ReportReport
Posted on by
Hi, 

When creating a new location record, I cannot attach an image at that step. I can only attach the image after the record is created. How can I enable image upload during the creation of a new location record?

 
Categories:
I have the same question (0)
  • Suggested answer
    mattavdven Profile Picture
    123 on at
    This record hasn't been created yet. To enable image upload, create this record.
     

    Hi @HH-22080318-0,

    Before you can upload an image or file to a Dataverse column, the record must already exist. This isn’t a setting you can enable or disable. 

    A good approach is to create a JavaScript function. With client-side JavaScript, you can automatically save a record when a field changes. For your case, you can attach the function to the LocationName field. When the value changes, the record will be saved automatically, and then you’ll be able to upload an image or file without manually saving first.

    Here’s an example you can use:

    function autoSaveOnLocationChange(executionContext) {
        var formContext = executionContext.getFormContext();
        formContext.data.entity.save();
    }

    • Add this function to a JavaScript web resource in your solution.

    • Then register it on the OnChange event of the LocationName field.

    • Each time the field changes, the record will automatically save. 

    •  

    Microsoft provides detailed documentation on form events: Learn Documentation

     

    You can create and edit the JavaScript file using Visual Studio Code and then add it to your solution in Power Apps.


     

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

Leaderboard > Microsoft Power Up Program Community

#1
timl Profile Picture

timl 169 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 136 Super User 2025 Season 2

#3
Gagan Singh Profile Picture

Gagan Singh 73

Last 30 days Overall leaderboard

Featured topics