• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

The amount of data in a metadata structure of type table

Participant ,
Apr 14, 2019 Apr 14, 2019

Copy link to clipboard

Copied

Thanks to your help, I can get a list of data from the table and enter my data there if necessary. Now I was wondering, can I find out how many rows are in the table?

value = {{RegItemId = 01ItemId, RegOrgId = 01OrgId},{RegItemId = 02ItemId, RegOrgId = 02OrgId},{RegItemId = 03ItemId, RegOrgId = 03OrgId}}

photo:setRawMetadata ("registryId", value)

That is, I have 3 rows in the registryId table. And if there is a possibility in the code to find out how many lines there, if I do not know it?

Thanks in advance!

TOPICS
SDK

Views

472

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 15, 2019 Apr 15, 2019

The table in the variable "value" is an array, and Lua gives the number of elements in an array using the "#" operator, e.g.

#value

Votes

Translate

Translate
LEGEND ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

The table in the variable "value" is an array, and Lua gives the number of elements in an array using the "#" operator, e.g.

#value

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

LATEST

Thanks! It is WORK:

local LrApplication = import("LrApplication")

local catalog = import("LrApplication").activeCatalog()

local targetPhoto = catalog:getTargetPhoto ()

a = targetPhoto:getFormattedMetadata ("registryId")

return #a

Answer 3

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines