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 :
Small and medium business | Business Central, N...
Suggested answer

Option field not returning correct value in API

(1) ShareShare
ReportReport
Posted on by 124
Hello, I created a Customer API page and the "Blocked" field is not returning the right value.
It should be blank, but it is returning "_x0020_".
Does anyone know how to resolve this?
Any help would be greatly appreciated, thank you!
 
This is how I added the Blocked field to the Customer API:
 
"Blocked" is set to blank on the customer card.
 
The API is returning "_x0020_" for the Blocked (the caption is Status) value.
 
 
I have the same question (0)
  • Suggested answer
    Teagen Boll Profile Picture
    183 on at
    Option field not returning correct value in API
    That is the expected behaviour for some fields. x0020 represent the space " " character as part of certain API responses. You can decode values using AL with Text.Replace like this:
    procedure DecodeValue(InputText: Text): Text
    begin
        exit(InputText.Replace('_x0020_', ' '));
    end;
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,267

#2
Sumit Singh Profile Picture

Sumit Singh 2,098

#3
YUN ZHU Profile Picture

YUN ZHU 1,766 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans