# I can't get any value from a Custom Field that keep a date data type

**URL:** <https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717>\
**Category:** API & Developers\
**Created:** [13 September 2021 21:05 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717 "2021-09-13T21:05:33Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Bernal](https://luna1.co/8d76cd.png) [@Daniel\_Bernal](https://forum.asana.com/u/Daniel_Bernal)\
**Post date:** [13 September 2021 21:05 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/1 "2021-09-13T21:05:33Z")

</div>

Hi, I’m trying to get a date value from a Custom Field, but just null (blank) is the result. I created the field as text as data type, and I already see the field, but has not any value in there.  
The login user has all the permission in Asana.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [13 September 2021 22:27 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/2 "2021-09-13T22:27:31Z")

</div>

Hi @Daniel_Bernal and welcome to the forum,

We’re going to need more detail in order to try and help out. Please post the code you’re using to retrieve the custom field and also post the result you’re getting back. Thanks!

---

<div class="post-metadata">

**Author:** ![Daniel\_Bernal](https://luna1.co/8d76cd.png) [@Daniel\_Bernal](https://forum.asana.com/u/Daniel_Bernal)\
**Post date:** [14 September 2021 12:11 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/3 "2021-09-14T12:11:39Z")

</div>

Hi Phil, thanks for reply.  
This code is Qlik Sense programming, very close and similar to an PL/SQL. This is an extract of the main query that I use to retrieve the data:  
Projects:  
LOAD  
id\_proyecto,  
“Campo Personalizado”,  
“Valor Personalizado”,  
if(“Campo Personalizado”=‘Fecha Prevista Inicio’,“Valor Personalizado”,null()) as ‘Fecha Prevista Inicio’  
FROM [lib://Asana QVD/\*.qvd] (qvd)  
;

Where “Campo Personalizado” means Custom Field, and \*.qvd means all qvd files (files from Qlik Sense, similar to an Excel file) that keep the data from the main query (API).  
After that, I create a table with id\_project and custom field:

FPI:  
Load Distinct  
id\_proyecto,  
[Fecha Prevista Inicio]  
Resident Projects;

That table give me the possibility of use that column in the report.  
Finally, I create the report, but the custom field is empty:

 ![image](https://us1.discourse-cdn.com/asana/original/3X/3/9/39e5d37a9f8ae2e196e10410f5c6e056e0d21aad.png)

If you need more information about the issue, just let me know.  
Thank you!

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [14 September 2021 13:58 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/4 "2021-09-14T13:58:22Z")

</div>

Unfortunately that code isn’t going to help me much as it’s very foreign. I don’t see anywhere where you’re actually issuing any query to Asana.

I highly recommend first using a tool like like Postman to get it working. Then I think it’ll be easier to translate that to your specific environment.

---

<div class="post-metadata">

**Author:** ![Daniel\_Bernal](https://luna1.co/8d76cd.png) [@Daniel\_Bernal](https://forum.asana.com/u/Daniel_Bernal)\
**Post date:** [14 September 2021 17:55 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/5 "2021-09-14T17:55:03Z")

</div>

Hi Phil, thank you again for your answer.  
This is the query that I get from ASANA:

RestConnectorMasterTable:  
SQL SELECT  
“gid” AS “gid\_u12”,  
“created\_at”,  
“current\_status”,  
“due\_on”,  
“due\_date”,  
“modified\_at”,  
“name” AS “name\_u11”,  
“start\_on”,  
“\_\_KEY\_data”,  
(SELECT  
“name” AS “name\_u1”,  
“number\_value”,  
“\_\_KEY\_custom\_fields”,  
“\_\_FK\_custom\_fields”,  
(SELECT  
“name” AS “name\_u0”,  
“\_\_FK\_enum\_value”  
FROM “enum\_value” FK “\_\_FK\_enum\_value”)  
FROM “custom\_fields” PK “\_\_KEY\_custom\_fields” FK “\_\_FK\_custom\_fields”),  
(SELECT  
“name” AS “name\_u6”,  
“\_\_FK\_followers”  
FROM “followers” FK “\_\_FK\_followers”),  
(SELECT  
“name” AS “name\_u7”,  
“\_\_FK\_members”  
FROM “members” FK “\_\_FK\_members”),  
(SELECT  
“name” AS “name\_u8”,  
“\_\_FK\_owner”  
FROM “owner” FK “\_\_FK\_owner”),  
(SELECT  
“name” AS “name\_u9”,  
“\_\_FK\_team”  
FROM “team” FK “\_\_FK\_team”),  
(SELECT  
“name” AS “name\_u10”,  
“\_\_FK\_workspace”  
FROM “workspace” FK “\_\_FK\_workspace”)  
FROM JSON (wrap off) “data” PK “\_\_KEY\_data”  
WITH CONNECTION(Url “[https://app.asana.com/api/1.0/projects/$(vIdProyecto)](https://app.asana.com/api/1.0/projects/$(vIdProyecto))”);

where $(vIdProyecto) read every project id previously loaded in that variable.

After that, I create this table:

[custom\_fields]:  
SELECT [name\_u1] AS [Campo Personalizado],  
[\_\_KEY\_custom\_fields],  
[number\_value] as ValorNumerico,  
[\_\_FK\_custom\_fields] AS [\_\_KEY\_data]  
FROM RestConnectorMasterTable  
WHERE NOT IsNull([\_\_FK\_custom\_fields]);

The problem appears with the fields created as text data types, not with the fields with number as data type.  
Field [name\_u1] has not any values.  
I can’t understand why this custom field has no value.

I’ll really appreciate if you can check this.

Thanks!

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [15 September 2021 01:34 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/6 "2021-09-15T01:34:33Z")

</div>

> [@Daniel\_Bernal](#):
>
> The problem appears with the fields created as text data types, not with the fields with number as data type.

From what I can see here, you’re only retrieving the number\_value from the custom field record, which would explain why text values are blank. Text values are stored in their own separate field (as are enum values).

The following is pseudocode as I don’t know your language, but I think you’ll need to do something akin to this (my changes are in bold italics):

SELECT [name\_u1] AS [Campo Personalizado],  
[\_\_KEY\_custom\_fields],  
[number\_value] as ValorNumerico,  
[\_\_FK\_custom\_fields] AS [\_\_KEY\_data]  
FROM RestConnectorMasterTable  
WHERE NOT IsNull([\_\_FK\_custom\_fields]) _**AND [resource\_subtype] = “number”;**_

SELECT [name\_u1] AS [Campo Personalizado],  
[\_\_KEY\_custom\_fields],  
[_**text\_value]**_ as ValorNumerico,  
[\_\_FK\_custom\_fields] AS [\_\_KEY\_data]  
FROM RestConnectorMasterTable  
WHERE NOT IsNull([\_\_FK\_custom\_fields]) _**AND [resource\_subtype] = “text”;**_

---

<div class="post-metadata">

**Author:** ![Larry\_Berger\_lpb](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/larry_berger_lpb/32/276017_2.png) [@Larry\_Berger\_lpb](https://forum.asana.com/u/Larry_Berger_lpb)\
**Post date:** [15 September 2021 02:04 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/7 "2021-09-15T02:04:07Z")

</div>

@Phil_Seeman and @Daniel_Bernal,

I think this may be able to be simplified a bit by using `display_value` instead of the several conditional ones specific to type. See more at: [https://developers.asana.com/docs/custom-field](https://developers.asana.com/docs/custom-field)

Thanks,

Larry

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [15 September 2021 02:09 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/8 "2021-09-15T02:09:26Z")

</div>

Good point, @Larry_Berger_lpb! In Flowsana I always have to deal with the underlying gid’s for enum values so I never use `display_value` but this looks like an excellent use case for using it.

---

<div class="post-metadata">

**Author:** ![Daniel\_Bernal](https://luna1.co/8d76cd.png) [@Daniel\_Bernal](https://forum.asana.com/u/Daniel_Bernal)\
**Post date:** [15 September 2021 15:54 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/9 "2021-09-15T15:54:00Z")

</div>

Hi Phil, thank you again.  
I understand what you mean. In the API code, i tried to write the sentence but it doesn’t work, I’m sure that is a sintaxis problem (this is just a part of the entire text):

(SELECT  
“name” AS “name\_u1”,  
“number\_value”,  
“\_\_KEY\_custom\_fields”,  
“\_\_FK\_custom\_fields”,  
(SELECT  
“name” AS “name\_u0”,  
“\_\_FK\_enum\_value”  
FROM “enum\_value” FK “\_\_FK\_enum\_value”  
**WHERE “resource\_subtype”=“text”** )  
FROM “custom\_fields” PK “\_\_KEY\_custom\_fields” FK “\_\_FK\_custom\_fields”),

Because effectively I read the enum values, and i’m trying to force it to text (bold).  
Could you tell me where must i write that sentence?

Thank you

---

<div class="post-metadata">

**Author:** ![Daniel\_Bernal](https://luna1.co/8d76cd.png) [@Daniel\_Bernal](https://forum.asana.com/u/Daniel_Bernal)\
**Post date:** [15 September 2021 15:56 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/10 "2021-09-15T15:56:34Z")

</div>

Hi lpb, thanks for answer.

In the code, not exists any part when i can specify the display\_value.  
It is possible to write it in the API code?

Thank you.

---

<div class="post-metadata">

**Author:** ![Larry\_Berger\_lpb](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/larry_berger_lpb/32/276017_2.png) [@Larry\_Berger\_lpb](https://forum.asana.com/u/Larry_Berger_lpb)\
**Post date:** [15 September 2021 18:07 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/11 "2021-09-15T18:07:54Z")

</div>

You may be able to replace number\_value and enum\_value with display\_value.

---

<div class="post-metadata">

**Author:** ![Daniel\_Bernal](https://luna1.co/8d76cd.png) [@Daniel\_Bernal](https://forum.asana.com/u/Daniel_Bernal)\
**Post date:** [16 September 2021 13:53 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/12 "2021-09-16T13:53:06Z")

</div>

Hi lpb, thanks again.  
I’ve trying with your solution but it doesn’t works. But maybe i don’t understand your message. This is the code that i ran:

```
(SELECT 
	"name" AS "name_u1",
	"display_value" as "number_value",
	"__KEY_custom_fields",
	"__FK_custom_fields",
	(SELECT 
		"display_value" AS "name_u0"
		"__FK_enum_value"
	FROM "enum_value" FK "__FK_enum_value")

```

I’ll be in holidays from today, so, only if it’s possible, I’ll be back with you next Monday.

Thank you!

---

<div class="post-metadata">

**Author:** ![Larry\_Berger\_lpb](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/larry_berger_lpb/32/276017_2.png) [@Larry\_Berger\_lpb](https://forum.asana.com/u/Larry_Berger_lpb)\
**Post date:** [16 September 2021 14:33 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/13 "2021-09-16T14:33:13Z")

</div>

Sorry, @Daniel_Bernal, I’m not sure I can be effective helping you; I don’t really know your environment and it’s too hard to debug remotely like this. Sorry about that…

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:05 UTC](https://forum.asana.com/t/i-cant-get-any-value-from-a-custom-field-that-keep-a-date-data-type/135717/14 "2025-05-30T19:05:12Z")

</div>

Closed on 30 May 2025 19:05 UTC


