question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New command: `m365 pp dataverse table row list`

See original GitHub issue

Usage

m365 pp dataverse table row list

Description

Lists table rows for the given dataverse table

Options

Option Description
-n, --name<name> The name of the dataverse table to retrieve rows from
-e, --environment <environment> The name of the environment to list all tables for
--asAdmin Set, to retrieve the dataverse tables as admin for environments you are not a member of

Examples

List all rows for the Appointment table

m365 pp dataverse table row list -environment  "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "Appointment"

List all rows for the Appointment table as Admin

m365 pp dataverse table row list -environment  "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "Appointment" --asAdmin

Additional Info

Since this is a list command we should not return all columns

Values can be retrieved from: https://[DYNAMICSURL]/api/data/v9.0/[msdyn_schemaname]?fetchXml=<fetchmapping="logical"returntotalrecordcount="true"page="1"count="10"no-lock="false"><entityname="crd2e_myfirsttable"><attributename="crd2e_name"/><orderattribute="crd2e_name"descending="false"/></entity></fetch>

The msdyn_schemaname is the full name including the prefix; that value can be found using https://[DYNAMICSURL]/api/data/v9.0/msdyn_solutioncomponentsummaries?%24filter=((msdyn_componenttype%20eq%201))%20and%20msdyn_objectid%20eq%20%27fGUID%27&api-version=9.1 where the GUID is the table id that is passed as table name

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
milanholemanscommented, Dec 3, 2022

I was reviewing the PR linked to this issue and noticed that maybe we should rename the option name. Since this command is called pp table row list, the option name would reflect to row instead of table.

Besides that, apparently we don’t need the table name at all, we need the ‘entity set name’. Now we are claiming that this is just the table name in plural, but according to the docs, this is not always the case. We can add some text in the Remarks section to clear out the difference for the user.

So all wrapped up, I think we should rename name to entitySetName to be correct. Another addition might be that we also add another option --tableName [tableName], which contains the logical name of the table. If the user specifies this, we can use dynamicsApiUrl/api/data/v9.0/EntityDefinitions(LogicalName='{logicalTableName}')?$select=EntitySetName to retrieve the entity set name of that particular table.

What do you think @appieschot @nicodecleyre, or other @pnp/cli-for-microsoft-365-maintainers can give their idea as well 😃

2reactions
nicodecleyrecommented, Nov 2, 2022

Hi @appieschot ,

Played around a bit with the api and i could find out following things: retrieving a table can be done by dynamicsApiUrl/api/data/v9.0/EntityDefinitions(LogicalName='logicalTableName')

regarding rows:

  • List all the rows from a table: GET dynamicsApiUrl/api/data/v9.0/logicalTableName returns all the rows. Could be used for the command in this issue 😄

  • Create a new row in a table: POST dynamicsApiUrl/api/data/v9.0/logicalTableName with in the body the columns with their data (use the Prefer: return=representation header if you want to return the created data) image results in: image For this we could make a new command m365 pp dataverse table row add

  • Update an existing row in a table: PATCH dynamicsApiUrl/api/data/v9.0/logicalTableName(id of the row) with in the body the columns with their data you want to update (use the Prefer: return=representation header if you want to return the updated data) For this we could make a new command m365 pp dataverse table row set

  • Associate the row to another table: PATCH dynamicsApiUrl/api/data/v9.0/logicalTableName(id of the row) and with in the body the property parentcustomerid_account set to otherLogicalTableName(id of that row). If you set this property to null, the row will be disassociate For this we could make a new command m365 pp dataverse table row associate & m365 pp dataverse table row disassociate

  • Delete an existing row in a table: DELETE dynamicsApiUrl/api/data/v9.0/logicaltablename(id of the row) For this we could make a new command m365 pp dataverse table row remove

  • Merge 2 rows (source will be moved to target & then source will be deactivated): POST dynamicsApiUrl/api/data/v9.0/merge For this we could make a new command m365 pp dataverse table row merge

Read more comments on GitHub >

github_iconTop Results From Across the Web

dataverse table list - CLI for Microsoft 365
pp dataverse table list ¶. Lists dataverse tables in a given environment. Usage¶. pp dataverse table list [options]. Options¶.
Read more >
New command: m365 pp dataverse table list #3653 - GitHub
I added the table segment as I can see that the CLI at some point should be able to add new tables as...
Read more >
Set up inventory components - Power Platform | Microsoft Learn
Go to Azure Active Directory > App registrations. Azure AD app registration. Select + New Registration. Enter a name (for example, CoE Command...
Read more >
How to create and modify Dataverse tables by using the Data ...
Create a new data column for the table. You'll need to specify the name, data type, and format along with other column configuration...
Read more >
Microsoft 365 monthly update – April 2022 - SharePoint Stuff
This new feature allows you to create sites, files, and lists right from within the SharePoint app bar. Select the Create command (the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found